<%-- 
    Document   : header
    Created on : Nov 16, 2014, 3:12:17 PM
    Author     : Hai
--%>
<%@include file="checkSession.jsp" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html> 
    <header>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

        <!-- bootstrap -->
        <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
        <!-- x-editable (bootstrap version) -->
        <link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.4.6/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet">
        <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    </header>
    <body>
        <%--
        /* kiem tra xem co phai la admin khong*/
        if (Integer.parseInt((String) session.getAttribute("lvl"))) == 0)
        --%>

        <%-- Static navbar --%>
        <nav class="navbar navbar-inverse navbar-fixed-top ">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">{Admin}</a>
                    <a class="navbar-brand glyphicon glyphicon-user" href="#">&nbsp;${sessionScope.user}</a>
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>                        
                    </button>
                </div>
                <div style="height: 1px;" aria-expanded="false" id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li class="active"><a class="navbar-brand glyphicon glyphicon-home" href="/index.jsp">&nbsp;Home</a></li>
                            <%-- dropdown phuot --%>
                        <li class="dropdown">
                            <a class="dropdown-toggle glyphicon glyphicon-asterisk" data-toggle="dropdown" role="button" aria-expanded="false">&nbsp;Phuot <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="/DiDau" title="upload">Đi đâu</a></li>
                                <li><a href="/list.jsp?where=chuyendi" title="upload">Lịch trình</a></li>
                                <li><a href="/list.jsp?where=nhatky" title="upload">Nhật ký</a></li>
                                <li><a href="/ThuHoach" title="upload">Thu Hoạch</a></li>
                            </ul>
                        </li>
                        <%-- ket thuc dropdown phuot --%>
                        <li><a class="glyphicon glyphicon-plus" href="/Postbai/index.jsp">&nbsp;Post</a></li>
                        <li><a class="glyphicon glyphicon-search" href="#">&nbsp;Timkiem</a></li>
                        <li><a class="glyphicon glyphicon-cog" href="#">&nbsp;{Manager}</a></li>
                        
                        <li><a class="trigger2" href="http://maps.google.com/" onclick="window.open(http://maps.google.com/)" rel="nofollow" target="_blank" title="English">Google Map</a></li>                
                            <%
                                /* Kiem tra co login hay khong*/
                                String login = null;
                                String sHref = null;

                                if (((String) session.getAttribute("id")) != null
                                        && ((String) session.getAttribute("user")) != null
                                        && ((String) session.getAttribute("lvl")) != null) {
                                    login = "Logout";
                                    sHref = Const.SiteConstant.logout;
                                    out.print("<li><a class='glyphicon glyphicon-off' href='" + sHref + "' rel='nofollow'>&nbsp;" + login + "</a></li>");
                                } else {
                                    login = "Login";
                                    sHref = Const.SiteConstant.login;
                                    out.print("<li><a class='glyphicon glyphicon-off' href='" + sHref + "' rel='nofollow'>&nbsp;" + login + "</a></li>");
                                }
                            %>              
                    </ul>
                </div>
            </div>
        </nav>
    </body>
</html>